getInstance{
  if (!(instance.get() instanceof CdiTestEnvironment)) {
    instance.set(new CdiTestEnvironment());
  return (CdiTestEnvironment)instance.get();
}
getComponent{ }
getComponent{
  try {
    if (clazz == StatefulKnowledgeSession.class) {
      if (resolveBean(Session.class,DefaultLiteral.INSTANCE) != null) {
        return clazz.cast(resolveBean(CdiTestJbpmKnowledgeSession.class,DefaultLiteral.INSTANCE).getKnowledgeSession());
 else {
        return clazz.cast(getKnowledgeSession());
    return resolveAndWrapBean(clazz,qualifiers);
 catch (  NoSuchMethodException e) {
    throw new RuntimeException(e);
catch (  InstantiationException e) {
    throw new RuntimeException(e);
catch (  IllegalAccessException e) {
    throw new RuntimeException(e);
catch (  InvocationTargetException e) {
    throw new RuntimeException(e);
}
resolveAndWrapBean{
  final T component=resolveBean(clazz,q);
  if (component != null) {
    ProxyFactory proxyFactory=new ProxyFactory();
    if (clazz.isInterface()) {
      proxyFactory.setInterfaces(new Class<?>[]{clazz});
      proxyFactory.setSuperclass(clazz);
    T proxy=clazz.cast(proxyFactory.create(new Class<?>[]{},new Object[]{},new MethodHandler(){
      @Override public Object invoke(      Object self,      Method thisMethod,      Method proceed,      Object[] args) throws Throwable {
        if (!thisMethod.getName().equals("finalize")) {
            beforeRequest(component);
            return thisMethod.invoke(component,args);
            afterRequest(component);
          return thisMethod.invoke(component,args);
    return proxy;
    return null;
}
invoke{
  if (!thisMethod.getName().equals("finalize")) {
    try {
      beforeRequest(component);
      return thisMethod.invoke(component,args);
  finally {
      afterRequest(component);
    return thisMethod.invoke(component,args);
}
resolveBean{
  Bean<T> bean=(Bean<T>)beanManager.resolve(beanManager.getBeans(clazz,q));
  final T component;
    component=(T)beanManager.getReference(bean,clazz,ctx);
    component=null;
  return component;
}
getBeanManager{
  return BeanManagerLocator.INSTANCE.locate();
}
getHibernateSessionFactory{
  if (this.sessionFactory == null) {
      Configuration hibernateConfiguration=new Configuration();
      hibernateConfiguration.configure(getHibernateConfigName());
      ConnectionProvider connProvider=ConnectionProviderFactory.newConnectionProvider(hibernateConfiguration.getProperties());
      ManagedHibernateSessionFactoryProvider.createSchemas(hibernateConfiguration,connProvider.getConnection());
      Connection connection=connProvider.getConnection();
      Statement st=connection.createStatement();
      connection.commit();
      st.close();
      connection.close();
      SchemaExport se=new SchemaExport(hibernateConfiguration);
      se.create(false,true);
      sessionFactory=hibernateConfiguration.buildSessionFactory();
 catch (    Throwable e) {
      e.printStackTrace();
      throw new RuntimeException(e);
  return sessionFactory;
}
reset{
  knowledgeSession=null;
  if (hibernateSession != null) {
}
getKnowledgeSession{
    if (this.abstractJbpmKnowledgeBase == null) {
    EnvironmentImpl env=new EnvironmentImpl();
    this.knowledgeSession=abstractJbpmKnowledgeBase.getKnowledgeBase().newStatefulKnowledgeSession(cfg,env);
}
createJbpmKnowledgeBase{ }
getHibernateConfigName{
  return "standalone-" + loadProperties().getProperty(HIBERNATE_CONFIG_NAME);
}
initializeDeployment{
  jar=new MockBeanDeploymentArchive();
  deployment=new MockDeployment(jar);
  Collection<URL> result=new HashSet<URL>();
  for (  String string : beansXmlFiles) {
    result.add(Thread.currentThread().getContextClassLoader().getResource(string));
  jar.setBeansXmlFiles(result);
  jar.setBeanClasses(allBeansList);
  lifecycle=new MockServletLifecycle(deployment,jar);
  lifecycle.initialize();
  lifecycle.beginApplication();
}
afterRequest{
  Object pop=componentStack.pop();
  if (pop != component) {
  if (componentStack.isEmpty()) {
      resolveBean(CdiTestSeamTransaction.class,DefaultLiteral.INSTANCE).commit();
      resolveBean(Session.class,DefaultLiteral.INSTANCE).close();
 catch (    RuntimeException e) {
      throw e;
catch (    Exception e) {
      throw new RuntimeException(e);
    lifecycle.endRequest();
    lifecycle.endSession();
}
beforeRequest{
  if (this.componentStack.isEmpty()) {
    lifecycle.beginSession();
    lifecycle.beginRequest();
      resolveBean(CdiTestSeamTransaction.class,DefaultLiteral.INSTANCE).begin();
 catch (    RuntimeException e) {
catch (    Exception e) {
      throw new RuntimeException(e);
  componentStack.push(component);
}
getMockClasses{
  return Arrays.asList(CditTestLogger.class,CdiTestHibernateSession.class,CdiTestSeamTransaction.class);
}
getImplementationClass{
  if (!o.getClass().isSynthetic() && !o.getClass().getName().contains("$$")) {
    return (Class<T>)o.getClass();
 else {
      BeanManagerImpl beanManager=getBeanManager();
      Bean<T> bean=(Bean<T>)beanManager.resolve(beanManager.getBeans(o.getClass().getInterfaces()[0],DefaultLiteral.INSTANCE));
      Set<Type> types=bean.getTypes();
      for (      Type type : types) {
        if (type instanceof Class && !((Class<?>)type).isInterface() && type != Object.class) {
    return c;
}
endRequestContext{ }
startRequestContext{ }
sendSignal{ }
newUmtPersistence{ }
getNotificationService{ }
createConversationalPersistence{ }
getUmtPersistence{ }
